{% extends "base.html" %}

{% block title %}排行{% endblock %}

{% block content %}
<div class="content">
    <h2 class="font-size-18 text-center">总排行</h2>
    <div class="card table-responsive specific-w-300 mw-100 mx-auto rounded-0">
        <table class="table">
            <thead>
                <tr>
                    <th scope="col">排名</th>
                    <th scope="col">站点</th>
                    <th scope="col">UV
                        <p class="d-inline font-size-12 m-0">独立访客</p>
                    </th>
                    <th scope="col">RV
                        <p class="d-inline font-size-12 m-0">来访访客</p>
                    </th>
                    <th scope="col">最后链入</th>
                    <th scope="col">最后受访</th>
                    <th scope="col">加入时间</th>
                </tr>
            </thead>
            <tbody>
                {% for r in rank %}
                <tr>
                    <th scope="row">{{ loop.index }}</th>
                    <td>
                        <a target="_blank" class="text-reset font-weight-bolder" data-toggle="tooltip"
                            data-title="{{ r.membership.description }}" href="https://{{ r.membership.domain }}"
                            title="{{ r.membership.name|e }}">
                            {{ r.membership.name|e }}
                        </a>
                    </td>
                    <td>{{ r.rank.unique_visitor }}</td>
                    <td>{{ r.rank.referrer }}</td>
                    <td>{{ r.rank.latest_referrer_at.format("%Y-%m-%d %H:%M:%S") }}</td>
                    <td>{{ r.rank.updated_at.format("%Y-%m-%d %H:%M:%S") }}</td>
                    <td>{{ r.rank.created_at.format("%Y-%m-%d %H:%M:%S") }}</td>
                </tr>
                {% endfor %}
            </tbody>
        </table>
    </div>

    <h2 class="font-size-18 text-center">即将移除</h2>
    <div class="card table-responsive specific-w-300 mw-100 mx-auto rounded-0">
        <table class="table">
            <thead>
                <tr>
                    <th scope="col">ID</th>
                    <th scope="col">站点</th>
                    <th scope="col">UV
                        <p class="d-inline font-size-12 m-0">独立访客</p>
                    </th>
                    <th scope="col">RV
                        <p class="d-inline font-size-12 m-0">来访访客</p>
                    </th>
                    <th scope="col">最后链入</th>
                    <th scope="col">最后受访</th>
                    <th scope="col">加入时间</th>
                </tr>
            </thead>
            <tbody>
                {% for r in to_be_remove %}
                <tr>
                    <th scope="row">
                        <del>
                            {{ r.membership.id }}
                        </del>
                    </th>
                    <td>
                        <del>
                            <a target="_blank" data-toggle="tooltip" data-title="{{ r.membership.description }}"
                                class="text-reset font-weight-bolder" href="https://{{ r.membership.domain }}"
                                title="{{ r.membership.name|e }}">
                                {{ r.membership.name|e }}
                            </a>
                        </del>
                    </td>
                    <td><del>{{ r.rank.unique_visitor }}</del></td>
                    <td><del>{{ r.rank.referrer }}</del></td>
                    <td>{{ r.rank.latest_referrer_at.format("%Y-%m-%d %H:%M:%S") }}</td>
                    <td>{{ r.rank.updated_at.format("%Y-%m-%d %H:%M:%S") }}</td>
                    <td>{{ r.rank.created_at.format("%Y-%m-%d %H:%M:%S") }}</td>
                </tr>
                {% endfor %}
            </tbody>
        </table>
    </div>
</div>
{% endblock %}